package com.codedancer.campus.client.api.carousel;

import com.codedancer.campus.client.service.ICarouselService;
import com.codedancer.campus.client.service.vo.carousel.CarouselVo;
import com.codedancer.campus.common.core.BaseApi;
import com.codedancer.campus.common.response.ApiResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/carousel")
@CrossOrigin(methods = {RequestMethod.GET, RequestMethod.POST, RequestMethod.DELETE,
    RequestMethod.PUT}, maxAge = 3600)
@Api(value = "轮播图Api", description = "轮播图Api", tags = "轮播图Api")
public class CarouselApi extends BaseApi {

    @Autowired
    private ICarouselService carouselService;

    @GetMapping("/list-all-enable")
    @ApiOperation("查询全部启用的轮播图")
    public ApiResponse<List<CarouselVo>> listAllEnable() {
        return success(carouselService.listAllEnable());
    }
}
